home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / nio / HeapLongBuffer.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  2.1 KB  |  122 lines

  1. package java.nio;
  2.  
  3. class HeapLongBuffer extends LongBuffer {
  4.    HeapLongBuffer(int var1, int var2) {
  5.       super(-1, 0, var2, var1, new long[var1], 0);
  6.    }
  7.  
  8.    HeapLongBuffer(long[] var1, int var2, int var3) {
  9.       super(-1, var2, var2 + var3, var1.length, var1, 0);
  10.    }
  11.  
  12.    protected HeapLongBuffer(long[] var1, int var2, int var3, int var4, int var5, int var6) {
  13.       super(var2, var3, var4, var5, var1, var6);
  14.    }
  15.  
  16.    public LongBuffer slice() {
  17.       return new HeapLongBuffer(this.hb, -1, 0, this.remaining(), this.remaining(), this.position() + this.offset);
  18.    }
  19.  
  20.    public LongBuffer duplicate() {
  21.       return new HeapLongBuffer(this.hb, this.markValue(), this.position(), this.limit(), this.capacity(), this.offset);
  22.    }
  23.  
  24.    public LongBuffer asReadOnlyBuffer() {
  25.       return new HeapLongBufferR(this.hb, this.markValue(), this.position(), this.limit(), this.capacity(), this.offset);
  26.    }
  27.  
  28.    // $FF: renamed from: ix (int) int
  29.    protected int method_0(int var1) {
  30.       return var1 + this.offset;
  31.    }
  32.  
  33.    public long get() {
  34.       return this.hb[this.method_0(this.nextGetIndex())];
  35.    }
  36.  
  37.    public long get(int var1) {
  38.       return this.hb[this.method_0(this.checkIndex(var1))];
  39.    }
  40.  
  41.    public LongBuffer get(long[] var1, int var2, int var3) {
  42.       checkBounds(var2, var3, var1.length);
  43.       if (var3 > this.remaining()) {
  44.          throw new BufferUnderflowException();
  45.       } else {
  46.          System.arraycopy(this.hb, this.method_0(this.position()), var1, var2, var3);
  47.          this.position(this.position() + var3);
  48.          return this;
  49.       }
  50.    }
  51.  
  52.    public boolean isDirect() {
  53.       return false;
  54.    }
  55.  
  56.    public boolean isReadOnly() {
  57.       return false;
  58.    }
  59.  
  60.    public LongBuffer put(long var1) {
  61.       this.hb[this.method_0(this.nextPutIndex())] = var1;
  62.       return this;
  63.    }
  64.  
  65.    public LongBuffer put(int var1, long var2) {
  66.       this.hb[this.method_0(this.checkIndex(var1))] = var2;
  67.       return this;
  68.    }
  69.  
  70.    public LongBuffer put(long[] var1, int var2, int var3) {
  71.       checkBounds(var2, var3, var1.length);
  72.       if (var3 > this.remaining()) {
  73.          throw new BufferOverflowException();
  74.       } else {
  75.          System.arraycopy(var1, var2, this.hb, this.method_0(this.position()), var3);
  76.          this.position(this.position() + var3);
  77.          return this;
  78.       }
  79.    }
  80.  
  81.    public LongBuffer put(LongBuffer var1) {
  82.       if (var1 instanceof HeapLongBuffer) {
  83.          if (var1 == this) {
  84.             throw new IllegalArgumentException();
  85.          }
  86.  
  87.          HeapLongBuffer var2 = (HeapLongBuffer)var1;
  88.          int var3 = var2.remaining();
  89.          if (var3 > this.remaining()) {
  90.             throw new BufferOverflowException();
  91.          }
  92.  
  93.          System.arraycopy(var2.hb, var2.method_0(var2.position()), this.hb, this.method_0(this.position()), var3);
  94.          var2.position(var2.position() + var3);
  95.          this.position(this.position() + var3);
  96.       } else if (var1.isDirect()) {
  97.          int var4 = var1.remaining();
  98.          if (var4 > this.remaining()) {
  99.             throw new BufferOverflowException();
  100.          }
  101.  
  102.          var1.get(this.hb, this.method_0(this.position()), var4);
  103.          this.position(this.position() + var4);
  104.       } else {
  105.          super.put(var1);
  106.       }
  107.  
  108.       return this;
  109.    }
  110.  
  111.    public LongBuffer compact() {
  112.       System.arraycopy(this.hb, this.method_0(this.position()), this.hb, this.method_0(0), this.remaining());
  113.       this.position(this.remaining());
  114.       this.limit(this.capacity());
  115.       return this;
  116.    }
  117.  
  118.    public ByteOrder order() {
  119.       return ByteOrder.nativeOrder();
  120.    }
  121. }
  122.